import { app, ipcMain } from 'electron'
import log from './helper/log'
import { Init } from './init'


const getSysConfig = () => {
  ipcMain.on('getSysConfig', async (event) => {
    log.log(`收到渲染线程获取配置命令，返回值为：${JSON.stringify(Init.config)}`)
    event.returnValue = Init.config
  })
}

const getDiskInfo = () => {
  ipcMain.handle('get-disk-info', async () => {
    return  Init.diskInfo
  })
}

export const initMainEventsListen = () => {
  getSysConfig()
  getDiskInfo()
}
